define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'mall.promotion_order/index',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh',
                ],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'promotion.name', title: '推广人'},
                    {field: 'mallOrder.goods_name', title: '商品名称'},
                    {field: 'mallOrder.order_no', title: '订单号', search: false},
                    {field: 'mallOrder.order_price', title: '价格', templet: ea.table.price, search: false},
                    {field: 'mallOrder.pay_time', title: '付款时间', search: false},
                    {
                        field: 'mallOrder-pay_time_left',
                        minWidth: 80,
                        title: '付款开始时间',
                        search: 'rangeLeft',
                        hide: true,
                        searchOp: 'rangeLeft'
                    },
                    {
                        field: 'mallOrder-pay_time_right',
                        minWidth: 80,
                        title: '付款结束时间',
                        search: 'rangeRight',
                        hide: true,
                        searchOp: 'rangeRight'
                    },
                    {field: 'orderUser.name', title: '下单用户', search: false},
                    {field: 'amount', title: '推广积分', search: false},
                ]],
            });

            ea.listen();
        },
    };
    return Controller;
});